﻿<!-- Views/Admin/EditExam.cshtml -->
@model WebApplication1.Models.Exam

@{
    ViewBag.Title = WebApplication1.Utilities.LanguageManager.GetText("Edit") + " " + WebApplication1.Utilities.LanguageManager.GetText("ExamName");
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card shadow-sm">
                <div class="card-header bg-warning text-white">
                    <h5 class="mb-0">
                        @WebApplication1.Utilities.LanguageManager.GetText("Edit") @WebApplication1.Utilities.LanguageManager.GetText("ExamName")
                    </h5>
                </div>
                <div class="card-body">
                    @using (Html.BeginForm())
                    {
                        @Html.AntiForgeryToken()
                        @Html.HiddenFor(model => model.ExamId)
                        @Html.HiddenFor(model => model.CreatedDate)

                        <div class="row">
                            <div class="col-md-8">
                                <div class="form-group mb-3">
                                    @Html.LabelFor(model => model.ExamName, WebApplication1.Utilities.LanguageManager.GetText("ExamName"), new { @class = "form-label" })
                                    @Html.EditorFor(model => model.ExamName, new { htmlAttributes = new { @class = "form-control", placeholder = WebApplication1.Utilities.LanguageManager.GetText("ExamName") } })
                                    @Html.ValidationMessageFor(model => model.ExamName, "", new { @class = "text-danger" })
                                </div>

                                <div class="form-group mb-3">
                                    @Html.LabelFor(model => model.Description, WebApplication1.Utilities.LanguageManager.GetText("Description"), new { @class = "form-label" })
                                    @Html.TextAreaFor(model => model.Description, new { @class = "form-control", rows = "3", placeholder = WebApplication1.Utilities.LanguageManager.GetText("Description") })
                                    @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
                                </div>

                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group mb-3">
                                            @Html.LabelFor(model => model.Duration, WebApplication1.Utilities.LanguageManager.GetText("Duration") + " (" + WebApplication1.Utilities.LanguageManager.GetText("Minutes") + ")", new { @class = "form-label" })
                                            @Html.EditorFor(model => model.Duration, new { htmlAttributes = new { @class = "form-control", placeholder = WebApplication1.Utilities.LanguageManager.GetText("Duration") } })
                                            @Html.ValidationMessageFor(model => model.Duration, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group mb-3">
                                            @Html.LabelFor(model => model.PassScore, WebApplication1.Utilities.LanguageManager.GetText("PassScore"), new { @class = "form-label" })
                                            @Html.EditorFor(model => model.PassScore, new { htmlAttributes = new { @class = "form-control", placeholder = WebApplication1.Utilities.LanguageManager.GetText("PassScore") } })
                                            @Html.ValidationMessageFor(model => model.PassScore, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group mb-3">
                                    @Html.LabelFor(model => model.IsActive, WebApplication1.Utilities.LanguageManager.GetText("Status"), new { @class = "form-label" })
                                    <div class="form-check">
                                        @Html.CheckBoxFor(model => model.IsActive, new { @class = "form-check-input" })
                                        @Html.LabelFor(model => model.IsActive, WebApplication1.Utilities.LanguageManager.GetText("Active"), new { @class = "form-check-label" })
                                    </div>
                                    @Html.ValidationMessageFor(model => model.IsActive, "", new { @class = "text-danger" })
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <button type="submit" class="btn btn-primary">
                                <i class="glyphicon glyphicon-save"></i> @WebApplication1.Utilities.LanguageManager.GetText("Save")
                            </button>
                            <a href="@Url.Action("Exams", "Admin")" class="btn btn-secondary">
                                <i class="glyphicon glyphicon-arrow-left"></i> @WebApplication1.Utilities.LanguageManager.GetText("Back")
                            </a>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>
</div>

<script src="~/Scripts/jquery-3.6.0.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>